// Copyright  2004-2008 Backplane Ltd.
//
// This file is part of Ubiquity formsPlayer
//
// Ubiquity formsPlayer is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3 of the License, or (at your
// option) any later version.
//
// Ubiquity formsPlayer is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License
// along with Ubiquity formsPlayer If not, see <http://www.gnu.org/licenses/>.
//	
//
//   Purpose: declaration of CImplGroup.
//   $Id$



#pragma once
#include "SingleNodeBinding.h"

class CXFormsElementGroup;

class CImplGroup : public CImplSingleNodeBinding
{
public:
	CImplGroup(CXFormsElementGroup* pElement);
	virtual ~CImplGroup();

//	virtual HRESULT RemoveChild(CImpl* pImpl);
	//virtual HRESULT AddChild(CImpl *pChild);
	void SetAsRepeatIndex(bool bIsIndex);
//	virtual bool reliesOnParent();
	void SetAsRepeatIteration(long lIndex);
	virtual CIdResolver * GetIdResolver() const;
	virtual HRESULT refresh();
	//CImplCaption* m_pCaption;
	virtual void buildDependencies();

	virtual HRESULT showFocus();
	virtual HRESULT onactivate();
	virtual void getInstanceNode(IXMLDOMNode ** pNode);
	//public due to poor design (called in CXFormsElement::DocumentReady, will make RO accessor for it), 
	//	I have made this const just to be certain that it doesn't get changed without someone 
	//	really meaning to do it.  Conceptually, it is const-ish, as the only two positions in which it
	//	should  be set are the constructor, or SetAsRepeatIteration, which is part of the initialisation
	//	i.e. during its practical lifetime it should not change.
	//	Ideally, repeat iterations should be a specialisation of group, rather than plain groups with
	//	a bool switching certain behaviours on and off, but that's for another day.
	const bool m_bIsRepeatIteration;
	HRESULT onDOMFocusIn_DefaultBehaviour();

	// blanking a group does nothing, as group has no value
	virtual HRESULT blank(void);
	virtual BSTR GenerateDebugDisplayInfo(void);

protected:
	virtual HRESULT  doInitialize();

private:
	bool m_bIsRepeatIndex;
	ULONG m_ulParentOffset;
	CIdResolver * m_pIdResolver;


};